Skip to content

fix: correct fetchRecurseSubmodules key lookup in from_gitmodules#34

Merged
bashandbone merged 2 commits intofeat/test-expansionfrom
copilot/sub-pr-33
Mar 19, 2026
Merged

fix: correct fetchRecurseSubmodules key lookup in from_gitmodules#34
bashandbone merged 2 commits intofeat/test-expansionfrom
copilot/sub-pr-33

Conversation

Copy link
Contributor

Copilot AI commented Mar 19, 2026

SubmoduleEntry::from_gitmodules was looking up "fetchRecurse" instead of "fetchRecurseSubmodules", the actual key used by git in .gitmodules. This caused fetch_recurse to always parse as None when reading gitmodules data.

Changes

  • src/config.rs: Updated from_gitmodules to check "fetchRecurseSubmodules" first, falling back to "fetchRecurse" for backward compatibility:
// Before
let fetch_recurse = entries
    .get("fetchRecurse")
    .and_then(|fr| SerializableFetchRecurse::from_gitmodules(fr).ok());

// After
let fetch_recurse = entries
    .get("fetchRecurseSubmodules")
    .or_else(|| entries.get("fetchRecurse"))
    .and_then(|fr| SerializableFetchRecurse::from_gitmodules(fr).ok());

This aligns from_gitmodules with the rest of the codebase (git2_ops.rs, gix_ops.rs, options.rs) which consistently uses fetchRecurseSubmodules as the git config key.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…etchRecurse fallback

Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix serialization/deserialization bug and expand testing fix: correct fetchRecurseSubmodules key lookup in from_gitmodules Mar 19, 2026
Copilot AI requested a review from bashandbone March 19, 2026 13:22
@bashandbone bashandbone marked this pull request as ready for review March 19, 2026 13:22
Copilot AI review requested due to automatic review settings March 19, 2026 13:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes parsing of the git submodule fetchRecurseSubmodules setting when reading .gitmodules by updating SubmoduleEntry::from_gitmodules to use the correct key (with a fallback for legacy input).

Changes:

  • Read fetchRecurseSubmodules first when parsing gitmodules entries.
  • Fall back to fetchRecurse for backward compatibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +529 to 531
.get("fetchRecurseSubmodules")
.or_else(|| entries.get("fetchRecurse"))
.and_then(|fr| SerializableFetchRecurse::from_gitmodules(fr).ok());
@bashandbone bashandbone merged commit 25b424e into feat/test-expansion Mar 19, 2026
4 checks passed
@bashandbone bashandbone deleted the copilot/sub-pr-33 branch March 19, 2026 13:35
bashandbone added a commit that referenced this pull request Mar 19, 2026
…in core areas. (#33)

* feat: Add schema; delete old CLAUDE.md for regeneration.

* fix: Fixed an issue with toml deserialization due to mismatched expectations between serialize and deserialize forms. Caught by some of the new expanded tests.

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix: correct fetchRecurseSubmodules key lookup in from_gitmodules (#34)

* Initial plan

* fix: use correct fetchRecurseSubmodules key in from_gitmodules with fetchRecurse fallback

Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>

* fix: SPDX headers in CLAUDE.md; delegate SerializableBranch deserialization to from_gitmodules (#36)

* Initial plan

* fix: add SPDX headers to CLAUDE.md; delegate SerializableBranch deserialization to from_gitmodules

Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Relocate branch deserialization test to correct module

Moved the test for branch deserialization from TOML to the appropriate test module.

* fix: correct TOML deserialization test for SerializableBranch empty/whitespace rejection (#37)

* Initial plan

* fix: use wrapper struct for branch TOML deserialization test to properly isolate SerializableBranch

Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants